<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>立项报价</title>
    <link rel="stylesheet" href="/lims/layui/css/layui.css?20190817.1">
    <link rel="stylesheet" href="/lims/css/common.css">
    <link rel="stylesheet" href="/lims/css/eleTree.css">
    <script src="/lims/layui/layui.js"></script>
    <script type="text/javascript" src="/lims/layui/global.js"></script>
    <script type="text/javascript" src="/js/jquery/jquery-1.9.1.js"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lims/js/common.js?v=20190726" type="text/javascript" charset="utf-8"></script>
    <script src="/lims/js/baseCode/base.js?v=2019080918:09" type="text/javascript" charset="utf-8"></script>
    <style>
        .layui-table-view .layui-table td, .layui-table-view .layui-table th {
            padding: 3px 0;
        }
        .layui-tab-item {
            height: 100%;
        }
        .layui-tab-item iframe{
            width: 100%;
            height:100%;
        }
    </style>
</head>
<body>
<div class="layui-card" style="margin:0;width: 100%;height: 100%;padding: 0;position: fixed;">
    <div class="layui-tab layui-tab-brief" lay-filter="looktabbar" style="height: 100%;">
        <ul class="layui-tab-title">
            <li><span style="font-size: 15px">基本信息</span></li>
            <li><span style="font-size: 15px">产品/实验信息</span></li>
            <li><span style="font-size: 15px">需求分析</span></li>
            <li><span style="font-size: 15px">外包/外协/外购</span></li>
            <li class="layui-this"><span style="font-size: 15px">立项报价</span></li>
            <li><span style="font-size: 15px">附件</span></li>
        </ul>
        <div class="layui-tab-content" style="position:relative;overflow:hidden;padding: 0;height: 100%;"></div>
    </div>
</div>
<script type="text/javascript">
    function getQueryString(name){
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }
    var typ = getQueryString("type");
    console.log(typ);
    $(function(){
        var runId=window.parent.runId;//获取 父页面 地址栏 参数 runId
        var projectId='';

        // 获取url参数 projectId和deptId
        $.ajax({
            url: '/workapp/work/selectProjectByRunId?runId='+runId,
            type: 'post',
            dataType: 'json',
            success: function (res) {
                if(res.code== 0){
                    projectId=res.object.projectId; //立项已经生成，后台返回立项Id
                    $("#lookQuotation").attr("src", '/project_quotation/tabQuotation?projectId='+projectId+'&status=1');
                }
            }
        });
        var temple='    <div class="layui-tab-item">' +
            '                <iframe frameborder="no"' +
            '                        src="/project_input/basicInfo?projectId='+projectId+'&begin=look"></iframe>' +
            '            </div>' +
            '            <div class="layui-tab-item">' +
            '                <iframe id="lookprourl" frameborder="no"' +
            '                        src="/project_input/productInfo?projectId='+projectId+'&begin=look"></iframe>' +
            '            </div>' +
            '            <div class="layui-tab-item">' +
            '                <iframe id="lookNeed" frameborder="no"' +
            '                        src="/project_task/analysis?projectId='+projectId+'&begin=look"></iframe>' +
            '            </div>' +
            '            <div class="layui-tab-item">' +
            '                <iframe id="lookFile" frameborder="no"' +
            '                        src="/project_task/outsource?projectId='+projectId+'&begin=look"></iframe>' +
            '            </div>' +
            '            <div class="layui-tab-item layui-show">' +
            '                <iframe id="lookQuotation" frameborder="no"' +
            '                        src="/project_quotation/tabQuotation?projectId='+projectId+'&status=1"></iframe>' +
            '            </div>' +
            '            <div class="layui-tab-item">' +
            '                <iframe id="lookFile2" frameborder="no"' +
            '                        src="/project_input/proappendix?projectId='+projectId+'&begin=look"></iframe>' +
            '            </div>'
        $('.layui-tab-content').append(temple)
    })

    layui.use(['table', 'layer', 'form', 'element'], function () {

    })
</script>
</body>
</html>